package com.yuyou.tas.util.enums.admin;

import com.yuyou.tas.util.exception.BusinessException;

public class AuthRoleEnums {
	
	public enum roleType{		
		system(1),organ(2),per(3),teacher(4),teaching(5),registrar(6),headmaster(7),other(8);
		roleType(int value){
			this.value=value;
		}		
		private int value;
		public int getValue() {
			return value;
		}			
	}
	

	public static int getRoleTypeByUserType(int userType){
		
		if(userType==AuthUserEnums.type.teacher.getValue()){
			return roleType.teacher.getValue();
		}
		else if(userType==AuthUserEnums.type.teaching.getValue()){
			return roleType.teaching.getValue();
		}
		else if(userType==AuthUserEnums.type.registrar.getValue()){
			return roleType.registrar.getValue();
		}
		else if(userType==AuthUserEnums.type.headmaster.getValue()){
			return roleType.headmaster.getValue();
		}
		else if(userType==AuthUserEnums.type.other.getValue()){
			return roleType.other.getValue();
		}
		throw new BusinessException();
	}
	
	
	

}
